package cn.edu.bupt.freewings.forum.front.utility;

import cn.edu.bupt.freewings.forum.common.TopicType;
import cn.edu.bupt.freewings.forum.common.UserType;

/**
 * @author hubaiyu (hubaiyu@gmail.com)
 * 
 */
public class TypeBuilder {
	public static TopicType.Topic makeTopic(String name, int creatorId,
			int projectId) {
		TopicType.Topic.Builder builder = TopicType.Topic.newBuilder();
		builder.setCreatorId(creatorId).setName(name).setProjectId(projectId);
		return builder.build();
	}

	public static UserType.User makeUser(String name, String nickName,
			String password) {
		UserType.User.Builder builder = UserType.User.newBuilder();
		builder.setName(name).setPassword(password).setNickName(nickName);
		return builder.build();
	}
}
